var jokeEl = document.getElementById("joke");
var btnEl = document.getElementById("btn");
getJoke();
btnEl.addEventListener("click",getJoke);



async function getJoke() {
    let response = await fetch('https://icanhazdadjoke.com/',{
        headers :{
            accept:'application/json'
        }
    })
    console.log(response);
    let jokeData =await response.json();
    jokeEl.innerHTML = jokeData.joke;
}